package com.coffee.sku.api.inquire.rep;

import com.coffee.core.util.DateUtil;
import com.coffee.sku.api.inquire.result.InquireSalesInformationResult;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

@Data
public class InquireSkuListRep implements Serializable {
    private Integer skuId;
    private String title;
    private String supplierName;
    private InquireSalesInformationResult skuSalesInformationResult;
    private String isEnable;
    private String isDisable;
    private String isApprove;
    private String pidPath;
    private String categoryName;
    private Date createTime;
    private Integer status;
    private String createTimeStr;

    public String getCreateTimeStr() {
        if (this.createTime != null) {
            return DateUtil.getDateTime(this.createTime, DateUtil.DEFAULT_DATETIME_FORMAT);
        }
        return createTimeStr;
    }

    public Integer getStatus() {
        if ("W".equals(this.isApprove)) {
            this.status = 0;
        } else if ("N".equals(this.isApprove)) {
            this.status = 1;
        } else if ("N".equals(this.isEnable)) {
            this.status = 3;
        } else if ("Y".equals(this.isEnable)) {
            this.status = 4;
        }
        return status;
    }


}
